package posti.test.swf.service;

import posti.test.swf.dao.GenericDAO;
import posti.test.swf.dao.Reference;

public class CRUDServiceImpl implements CRUDService {
	private GenericDAO dao;
	
	public CRUDServiceImpl(GenericDAO dao) {
		this.dao = dao;
	}

	public Reference create(Object domainObject) {
		return dao.reference(domainObject);
	}

	public void delete(Object object) {
		dao.delete(object);
	}

	public Reference reference(Object obj) {
		return dao.reference(obj);
	}

	public Object retrieve(Reference reference) {
		return dao.load(reference);
	}

	public Object save(Object obj) {
		return dao.saveOrUpdate(obj);
	}

}
